using System.BusinessObjects.Transactions;
using NHibernate;

namespace Blazing.BusinessObjects.Queries
{
    public class QrySearchChildLocaions
    {
        public static IQuery Query(int parentId)
        {
            string nql = "select l from Location l where l.ParentLocation = :parentLocation";
            IQuery qry = UnitOfWork.CurrentSession.CreateQuery(nql);
            qry.SetInt32("parentLocation", parentId);

            qry.SetCacheable(true);
            return qry;
        }
    }
}
